import { ref, watchEffect } from "vue";
const tabbarPathList = ref(sessionStorage.getItem("tabbarPathList") ? JSON.parse(sessionStorage.getItem("tabbarPathList")) : []);
watchEffect(() => {
  sessionStorage.setItem("tabbarPathList", JSON.stringify(tabbarPathList.value));
});
function useTabbarPathStore() {
  const addPath = (fullPath) => {
    const index = tabbarPathList.value.findIndex((path) => fullPath === path);
    if (index === -1) {
      tabbarPathList.value.push(fullPath);
    }
  };
  const updatePath = (fullPath) => {
    const index = tabbarPathList.value.findIndex((path) => fullPath === path);
    tabbarPathList.value.splice(index, 1);
    tabbarPathList.value.push(fullPath);
  };
  const closePath = (fullPath) => {
    const index = tabbarPathList.value.findIndex((path) => fullPath === path);
    if (index > -1) {
      tabbarPathList.value.splice(index, 1);
    }
  };
  const hasPath = (fullPath) => {
    return tabbarPathList.value.includes(fullPath);
  };
  return {
    tabbarPathList,
    addPath,
    updatePath,
    closePath,
    hasPath
  };
}
export {
  useTabbarPathStore
};
//# sourceMappingURL=useTabbarPathStore.mjs.map
